import 'package:word_game/battle/equipment/equipment.dart';
import 'package:word_game/engine/core.dart';
import 'package:word_game/rpg_hero.dart';

class EquipEvent extends Eventable {
  EquipEvent() : super('装备');
  
  @override
  void doEvent(owner) {
    Equipment equipment = owner as Equipment;
    var rpgHero = World.instance.hero as RPGHero;
    rpgHero.equipmentView.equip(equipment);
    rpgHero.bag.things.removeWhere((test) => test.code==equipment.code);
    Focus.current.back();
  }
}